
Page({


  data: {
   
    //标记点
    markers: [{
      id: 0,
      name: "编程不打烊",
      address: "杭州市",
      latitude: 40.61018,
      longitude: 120.75619,
      width: 50,
      height: 50
    }]
  },


  navRoad(event) {
    var that = this;
    wx.getLocation({
      type: 'wgs84',
      success: res => {
        console.log('授权成功', res)
        wx.openLocation({ 
          latitude: that.data.latitude,
          longitude: that.data.longitude,
          
        })
      },
    })




  },
  onLoad(){
    var that = this;
    wx.getLocation({
      type: 'wgs84',
      success(res){
        console.log(res)
        that.setData({
          latitude:res.latitude,
          longitude:res.longitude,
        })
      }
    })
  }
  
})